/*
 * Wire
 * Copyright (C) 2018 Wire Swiss GmbH
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program. If not, see http://www.gnu.org/licenses/.
 *
 */

.search-list {
  .search-list-sm& {
    display: flex;
    flex-wrap: wrap;
  }
}

.search-list-item {
  cursor: pointer;
  margin-bottom: 16px;
  overflow: hidden;

  .search-list-sm & {
    text-align: center;

    &:nth-child(3n) {
      margin-right: 0;
    }
  }

  .search-list-lg & {
    display: flex;
    height: 56px;
    margin: 0;
  }
}

.search-list-item-image {
  .search-list-sm & {
    .square(@avatar-diameter-l);
    position: relative;
    margin-bottom: 3px;
  }

  .search-list-lg & {
    flex: 0 0 auto;
    height: @avatar-diameter-m;
    position: relative;
    display: flex;
    align-items: center;
  }
}

.search-list-item-image-guest-indicator-badge {
  .guest-badge;
  bottom: 0;
  left: 50%;
  position: absolute;
  transform: translateX(-50%);
}

.search-list-item-image-overlay {
  .full-screen();
  align-items: center;
  justify-content: center;
  display: flex;

  .background {
    .full-screen();
    border-radius: 50%;
    opacity: 0;
  }

  .checkmark {
    transform: scale(1.8);
    opacity: 0;
  }
}

.search-list-item-content {
  align-items: flex-start;
  justify-content: center;
  display: flex;
  flex-direction: column;

  .search-list-sm & {
    width: @avatar-diameter-l;
  }

  .search-list-lg & {
    flex: 1 1;
    height: @avatar-diameter-m;
    margin-left: 16px;
    min-width: 0; // this will ensure that ellipses is working
  }
}

.search-list-item-content-availability {
  .availability-state-label {
    .ellipsis;
  }

  .search-list-sm & {
    height: 12px;
    justify-content: center;
  }
}

.search-list-item-content-name {
  .ellipsis;
  width: 100%;

  .search-list-sm & {
    .label-xs();
  }
}

.search-list-item-content-info {
  display: flex;
  font-size: @font-size-xs;
  line-height: 16px;
  opacity: 0.56;
}

.search-list-item-header {
  .ellipsis;
  height: @avatar-diameter-m;
  line-height: @avatar-diameter-m;
  margin-left: 16px;
  max-width: 184px;
}

.search-list-theme-black .image.state-badge::before {
  background-color: #000;
  color: #fff;
}

.search-list-item-guest-indicator {
  font-size: @font-size-xs;
  height: @avatar-diameter-m;
  display: flex;
  align-items: center;
}

.search-list-item-select {
  .square(24px);
  display: block;
  border: 2px solid fade(@graphite-dark, 64%);
  border-radius: 12px;
  margin: 8px 0 8px 16px;

  &::before {
    color: #fff;
    font-size: 12px;
    margin-left: 4px;
    opacity: 0;
  }

  &.selected {
    border: 2px solid @graphite-dark;
    background-color: @graphite-dark;

    &::before {
      opacity: 1;
    }
  }
}

.search-list-item-guest-indicator-badge {
  .guest-badge;

  .user-list-light & {
    .cell-badge-dark();
  }
}
